import Vue from 'vue';
import VueRouter from 'vue-router';
import CampusBinhai from '../views/CampusBinhai.vue';
import CampusChashan from '../views/CampusChashan.vue';
import CampusYueqing from '../views/CampusYueqing.vue';
import StudentSystem from '../views/StudentSystem.vue';
import Building5 from '../views/Building5.vue'; // 新增导入
import Building6 from '../views/Building6.vue'; // 新增导入
import Building7 from '../views/Building7.vue'; // 新增导入

Vue.use(VueRouter);

const routes = [
  {
    path: '/',
    name: 'CampusBinhai',
    component: CampusBinhai
  },
  {
    path: '/chashan',
    name: 'CampusChashan',
    component: CampusChashan,
    children: [
      { path: '5', component: Building5, name: 'Building5' }, // 使用新建组件
      { path: '6', component: Building6, name: 'Building6' }, // 使用新建组件
      { path: '7', component: Building7, name: 'Building7' }  // 使用新建组件
    ]
  },
  {
    path: '/yueqing',
    name: 'CampusYueqing',
    component: CampusYueqing
  },
  {
    path: '/system',
    name: 'StudentSystem',
    component: StudentSystem
  }
];

const router = new VueRouter({
  mode: 'history',
  routes
});

export default router;